home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 1997 May / PC Plus Super CD Issue 127 (May 1997).iso / delphi2 / delphite.exe / data.z / DBREG.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1996-08-12  |  21.0 KB  |  794 lines

  1.  
  2. {*******************************************************}
  3. {                                                       }
  4. {       Delphi Visual Component Library                 }
  5. {                                                       }
  6. {       Copyright (c) 1995,96 Borland International     }
  7. {                                                       }
  8. {*******************************************************}
  9.  
  10. unit DBReg;
  11.  
  12. interface
  13.  
  14. procedure Register;
  15.  
  16. implementation
  17.  
  18. uses
  19.   SysUtils, Classes, DsgnIntf, Controls, Forms, DB, DBTables, DBCtrls,
  20.   DBGrids,
  21.   MaskProp, MaskText, Mask, DBConsts, DBLookup, DSDesign, DBEdit, FldLinks,
  22.   TypInfo, EditIntf, ExptIntf, ToolIntf, LibConst, QBE, QBindDlg, ProcDlg,
  23.   IxEdit, dbColEdt, DbxTarg, UpdSqlEd, DbXPlor, DBExpt, DBInpReq;
  24.  
  25. { TDataSetEditor }
  26.  
  27. type
  28.   TDataSetEditor = class(TComponentEditor)
  29.     procedure ExecuteVerb(Index: Integer); override;
  30.     function GetVerb(Index: Integer): string; override;
  31.     function GetVerbCount: Integer; override;
  32.   end;
  33.  
  34. procedure TDataSetEditor.ExecuteVerb(Index: Integer);
  35. begin
  36.   case Index of
  37.     0: ShowDatasetDesigner(Designer, TTable(Component));
  38.     1: ExploreDataset(TDBDataset(Component));
  39.   end;
  40. end;
  41.  
  42. function TDataSetEditor.GetVerb(Index: Integer): string;
  43. begin
  44.   case Index of
  45.     0: Result := LoadStr(SDatasetDesigner);
  46.     1: Result := LoadStr(SExplore);
  47.   end;
  48. end;
  49.  
  50. function TDataSetEditor.GetVerbCount: Integer;
  51. begin
  52.   Result := Ord(Component is TDBDataset) + 1;
  53. end;
  54.  
  55. { TDatabaseEditor }
  56.  
  57. type
  58.   TDatabaseEditor = class(TComponentEditor)
  59.     procedure ExecuteVerb(Index: Integer); override;
  60.     function GetVerb(Index: Integer): string; override;
  61.     function GetVerbCount: Integer; override;
  62.   end;
  63.  
  64. procedure TDatabaseEditor.ExecuteVerb(Index: Integer);
  65. begin
  66.   case Index of
  67.     0: if EditDatabase(TDatabase(Component)) then Designer.Modified;
  68.     1: ExploreDatabase(TDatabase(Component));
  69.   end;
  70. end;
  71.  
  72. function TDatabaseEditor.GetVerb(Index: Integer): string;
  73. begin
  74.   case Index of
  75.     0: Result := LoadStr(SDatabaseEditor);
  76.     1: Result := LoadStr(SExplore);
  77.   end;
  78. end;
  79.  
  80. function TDatabaseEditor.GetVerbCount: Integer;
  81. begin
  82.   Result := 2;
  83. end;
  84.  
  85. { TBatchMoveEditor }
  86.  
  87. type
  88.   TBatchMoveEditor = class(TDefaultEditor)
  89.     procedure ExecuteVerb(Index: Integer); override;
  90.     function GetVerb(Index: Integer): string; override;
  91.     function GetVerbCount: Integer; override;
  92.   end;
  93.  
  94. procedure TBatchMoveEditor.ExecuteVerb(Index: Integer);
  95. begin
  96.   TBatchMove(Component).Execute;
  97. end;
  98.  
  99. function TBatchMoveEditor.GetVerb(Index: Integer): string;
  100. begin
  101.   Result := LoadStr(SBatchExecute);
  102. end;
  103.  
  104. function TBatchMoveEditor.GetVerbCount: Integer;
  105. begin
  106.   Result := 1;
  107. end;
  108.  
  109. { TDataSetProperty }
  110.  
  111. type
  112.   TDataSetProperty = class(TComponentProperty)
  113.   private
  114.     FCheckProc: TGetStrProc;
  115.     procedure CheckComponent(const Value: string);
  116.   public
  117.     procedure GetValues(Proc: TGetStrProc); override;
  118.   end;
  119.  
  120. procedure TDataSetProperty.CheckComponent(const Value: string);
  121. var
  122.   J: Integer;
  123.   Dataset: TDataset;
  124. begin
  125.   Dataset := TDataset(Designer.GetComponent(Value));
  126.   for J := 0 to PropCount - 1 do
  127.     if TDataSource(GetComponent(J)).IsLinkedTo(Dataset) then
  128.       Exit;
  129.   FCheckProc(Value);
  130. end;
  131.  
  132. procedure TDataSetProperty.GetValues(Proc: TGetStrProc);
  133. begin
  134.   FCheckProc := Proc;
  135.   inherited GetValues(CheckComponent);
  136. end;
  137.  
  138. { TDataSourceProperty }
  139.  
  140. type
  141.   TDataSourceProperty = class(TComponentProperty)
  142.   private
  143.     FCheckProc: TGetStrProc;
  144.     procedure CheckComponent(const Value: string);
  145.   public
  146.     procedure GetValues(Proc: TGetStrProc); override;
  147.   end;
  148.  
  149. procedure TDataSourceProperty.CheckComponent(const Value: string);
  150. var
  151.   J: Integer;
  152.   DataSource: TDataSource;
  153. begin
  154.   DataSource := TDataSource(Designer.GetComponent(Value));
  155.   for J := 0 to PropCount - 1 do
  156.     if TDataSet(GetComponent(J)).IsLinkedTo(DataSource) then
  157.       Exit;
  158.   FCheckProc(Value);
  159. end;
  160.  
  161. procedure TDataSourceProperty.GetValues(Proc: TGetStrProc);
  162. begin
  163.   FCheckProc := Proc;
  164.   inherited GetValues(CheckComponent);
  165. end;
  166.  
  167. { TDBStringProperty }
  168.  
  169. type
  170.   TDBStringProperty = class(TStringProperty)
  171.   public
  172.     function GetAttributes: TPropertyAttributes; override;
  173.     procedure GetValueList(List: TStrings); virtual; abstract;
  174.     procedure GetValues(Proc: TGetStrProc); override;
  175.   end;
  176.  
  177. function TDBStringProperty.GetAttributes: TPropertyAttributes;
  178. begin
  179.   Result := [paValueList, paSortList, paMultiSelect];
  180. end;
  181.  
  182. procedure TDBStringProperty.GetValues(Proc: TGetStrProc);
  183. var
  184.   I: Integer;
  185.   Values: TStringList;
  186. begin
  187.   Values := TStringList.Create;
  188.   try
  189.     GetValueList(Values);
  190.     for I := 0 to Values.Count - 1 do Proc(Values[I]);
  191.   finally
  192.     Values.Free;
  193.   end;
  194. end;
  195.  
  196. { TSessionNameProperty }
  197.  
  198. type
  199.   TSessionNameProperty = class(TDBStringProperty)
  200.   public
  201.     procedure GetValueList(List: TStrings); override;
  202.   end;
  203.  
  204. procedure TSessionNameProperty.GetValueList(List: TStrings);
  205. begin
  206.   Sessions.GetSessionNames(List);
  207. end;
  208.  
  209. { TDatabaseNameProperty }
  210.  
  211. type
  212.   TDatabaseNameProperty = class(TDBStringProperty)
  213.   public
  214.     procedure GetValueList(List: TStrings); override;
  215.   end;
  216.  
  217. procedure TDatabaseNameProperty.GetValueList(List: TStrings);
  218. begin
  219.   (GetComponent(0) as TDBDataSet).DBSession.GetDatabaseNames(List);
  220. end;
  221.  
  222. { TAliasNameProperty }
  223.  
  224. type
  225.   TAliasNameProperty = class(TDBStringProperty)
  226.   public
  227.     procedure GetValueList(List: TStrings); override;
  228.   end;
  229.  
  230. procedure TAliasNameProperty.GetValueList(List: TStrings);
  231. begin
  232.   (GetComponent(0) as TDatabase).Session.GetAliasNames(List);
  233. end;
  234.  
  235. { TDriverNameProperty }
  236.  
  237. type
  238.   TDriverNameProperty = class(TDBStringProperty)
  239.   public
  240.     procedure GetValueList(List: TStrings); override;
  241.   end;
  242.  
  243. procedure TDriverNameProperty.GetValueList(List: TStrings);
  244. begin
  245.   (GetComponent(0) as TDatabase).Session.GetDriverNames(List);
  246. end;
  247.  
  248. { TTableNameProperty }
  249.  
  250. type
  251.   TTableNameProperty = class(TDBStringProperty)
  252.   public
  253.     procedure GetValueList(List: TStrings); override;
  254.   end;
  255.  
  256. procedure TTableNameProperty.GetValueList(List: TStrings);
  257. const
  258.   Masks: array[TTableType] of string[5] = ('', '*.DB', '*.DBF', '*.TXT');
  259. var
  260.   Table: TTable;
  261. begin
  262.   Table := GetComponent(0) as TTable;
  263.   Table.DBSession.GetTableNames(Table.DatabaseName, Masks[Table.TableType],
  264.     Table.TableType = ttDefault, False, List);
  265. end;
  266.  
  267. { TIndexNameProperty }
  268.  
  269. type
  270.   TIndexNameProperty = class(TDBStringProperty)
  271.   public
  272.     procedure GetValueList(List: TStrings); override;
  273.   end;
  274.  
  275. procedure TIndexNameProperty.GetValueList(List: TStrings);
  276. begin
  277.   (GetComponent(0) as TTable).GetIndexNames(List);
  278. end;
  279.  
  280. { TProcedureNameProperty }
  281.  
  282. type
  283.   TProcedureNameProperty = class(TDBStringProperty)
  284.   public
  285.     procedure GetValueList(List: TStrings); override;
  286.   end;
  287.  
  288. procedure TProcedureNameProperty.GetValueList(List: TStrings);
  289. var
  290.   DBDataSet: TDBDataSet;
  291. begin
  292.   DBDataSet := GetComponent(0) as TDBDataSet;
  293.   DBDataSet.DBSession.GetStoredProcNames(DBDataSet.DatabaseName, List);
  294. end;
  295.  
  296. { TIndexFieldNamesProperty }
  297.  
  298. type
  299.   TIndexFieldNamesProperty = class(TDBStringProperty)
  300.   public
  301.     procedure GetValueList(List: TStrings); override;
  302.   end;
  303.  
  304. procedure TIndexFieldNamesProperty.GetValueList(List: TStrings);
  305. var
  306.   I: Integer;
  307. begin
  308.   with GetComponent(0) as TTable do
  309.   begin
  310.     IndexDefs.Update;
  311.     for I := 0 to IndexDefs.Count - 1 do
  312.       with IndexDefs[I] do
  313.         if not (ixExpression in Options) then List.Add(Fields);
  314.   end;
  315. end;
  316.  
  317. { TDataFieldProperty }
  318.  
  319. type
  320.   TDataFieldProperty = class(TDBStringProperty)
  321.   public
  322.     function GetDataSourcePropName: string; virtual;
  323.     procedure GetValueList(List: TStrings); override;
  324.   end;
  325.  
  326. function TDataFieldProperty.GetDataSourcePropName: string;
  327. begin
  328.   Result := 'DataSource';
  329. end;
  330.  
  331. procedure TDataFieldProperty.GetValueList(List: TStrings);
  332. var
  333.   Instance: TComponent;
  334.   PropInfo: PPropInfo;
  335.   DataSource: TDataSource;
  336. begin
  337.   Instance := GetComponent(0);
  338.   PropInfo := TypInfo.GetPropInfo(Instance.ClassInfo, GetDataSourcePropName);
  339.   if (PropInfo <> nil) and (PropInfo^.PropType^.Kind = tkClass) then
  340.   begin
  341.     DataSource := TObject(GetOrdProp(Instance, PropInfo)) as TDataSource;
  342.     if (DataSource <> nil) and (DataSource.DataSet <> nil) then
  343.       DataSource.DataSet.GetFieldNames(List);
  344.   end;
  345. end;
  346.  
  347. { TLookupSourceProperty }
  348.  
  349. type
  350.   TLookupSourceProperty = class(TDBStringProperty)
  351.   public
  352.     procedure GetValueList(List: TStrings); override;
  353.   end;
  354.  
  355. procedure TLookupSourceProperty.GetValueList(List: TStrings);
  356. begin
  357.   with GetComponent(0) as TField do
  358.     if DataSet <> nil then DataSet.GetFieldNames(List);
  359. end;
  360.  
  361. { TLookupDestProperty }
  362.  
  363. type
  364.   TLookupDestProperty = class(TDBStringProperty)
  365.   public
  366.     procedure GetValueList(List: TStrings); override;
  367.   end;
  368.  
  369. procedure TLookupDestProperty.GetValueList(List: TStrings);
  370. begin
  371.   with GetComponent(0) as TField do
  372.     if LookupDataSet <> nil then LookupDataSet.GetFieldNames(List);
  373. end;
  374.  
  375. { TListFieldProperty }
  376.  
  377. type
  378.   TListFieldProperty = class(TDataFieldProperty)
  379.   public
  380.     function GetDataSourcePropName: string; override;
  381.   end;
  382.  
  383. function TListFieldProperty.GetDataSourcePropName: string;
  384. begin
  385.   Result := 'ListSource';
  386. end;
  387.  
  388. { TLookupFieldProperty }
  389.  
  390. type
  391.   TLookupFieldProperty = class(TDataFieldProperty)
  392.   public
  393.     function GetDataSourcePropName: string; override;
  394.   end;
  395.  
  396. function TLookupFieldProperty.GetDataSourcePropName: string;
  397. begin
  398.   Result := 'LookupSource';
  399. end;
  400.  
  401. { TLookupIndexProperty }
  402.  
  403. type
  404.   TLookupIndexProperty = class(TLookupFieldProperty)
  405.   public
  406.     procedure GetValueList(List: TStrings); override;
  407.   end;
  408.  
  409. procedure TLookupIndexProperty.GetValueList(List: TStrings);
  410. var
  411.   Instance: TComponent;
  412.   PropInfo: PPropInfo;
  413.   DataSource: TDataSource;
  414. begin
  415.   Instance := GetComponent(0);
  416.   PropInfo := TypInfo.GetPropInfo(Instance.ClassInfo, GetDataSourcePropName);
  417.   if (PropInfo <> nil) and (PropInfo^.PropType^.Kind = tkClass) then
  418.   begin
  419.     DataSource := TObject(GetOrdProp(Instance, PropInfo)) as TDataSource;
  420.     if (DataSource <> nil) and (DataSource.DataSet <> nil) then
  421.     begin
  422.       if (DataSource.DataSet is TTable) and
  423.           (TTable(DataSource.DataSet).IndexFieldCount > 0) then
  424.         List.Add(TTable(DataSource.DataSet).IndexFields[0].FieldName)
  425.       else
  426.         DataSource.DataSet.GetFieldNames(List);
  427.     end;
  428.   end;
  429. end;
  430.  
  431. { TDBImageEditor }
  432.  
  433. type
  434.   TDBImageEditor = class(TDefaultEditor)
  435.   public
  436.     procedure Copy; override;
  437.   end;
  438.  
  439. procedure TDBImageEditor.Copy;
  440. begin
  441.   TDBImage(Component).CopyToClipboard;
  442. end;
  443.  
  444. { TQueryEditor }
  445.  
  446. type
  447.   TQueryEditor = class(TComponentEditor)
  448.   private
  449.     procedure ExecuteVerb(Index: Integer); override;
  450.     function GetVerb(Index: Integer): string; override;
  451.     function GetVerbCount: Integer; override;
  452.   end;
  453.  
  454. procedure TQueryEditor.ExecuteVerb(Index: Integer);
  455. var
  456.   Query: TQuery;
  457.   List: TParams;
  458. begin
  459.   Query := Component as TQuery;
  460.   case Index of
  461.     0: ShowDatasetDesigner(Designer, TTable(Component));
  462.     1:
  463.       begin
  464.         List := TParams.Create;
  465.         try
  466.           List.Assign(Query.Params);
  467.           if EditQueryParams(Query, List) then
  468.           begin
  469.             Query.Close;
  470.             Query.Params := List;
  471.             if Designer <> nil then Designer.Modified;
  472.           end;
  473.         finally
  474.           List.Free;
  475.         end;
  476.      end;
  477.     2: ExploreDataset(TDBDataset(Component));
  478.     3:
  479.       begin
  480.         ExecBuilder(Query);
  481.         if Designer <> nil then Designer.Modified;
  482.       end;
  483.   end;
  484. end;
  485.  
  486. function TQueryEditor.GetVerb(Index: Integer): string;
  487. begin
  488.   case Index of
  489.     0: Result := LoadStr(SSQLDatasetDesigner);
  490.     1: Result := LoadStr(SBindVerb);
  491.     2: Result := LoadStr(SExplore);
  492.     3: Result := LoadStr(SQBEVerb);
  493.   end;
  494. end;
  495.  
  496. function TQueryEditor.GetVerbCount: Integer;
  497. begin
  498.   if not VQBLoadAttempted then InitVQB;
  499.   if VQBLoaded then Result := 4
  500.   else Result := 3;
  501. end;
  502.  
  503. { TStoredProcEditor }
  504.  
  505. procedure EditStoredProcParams(StoredProc: TStoredProc; Designer: TDesigner);
  506. var
  507.   List: TParams;
  508. begin
  509.   List := TParams.Create;
  510.   try
  511.     StoredProc.CopyParams(List);
  512.     if EditProcParams(StoredProc, List) then
  513.     begin
  514.       StoredProc.Params := List;
  515.       if Designer <> nil then Designer.Modified;
  516.     end;
  517.   finally
  518.     List.Free;
  519.   end;
  520. end;
  521.  
  522. type
  523.   TStoredProcEditor = class(TComponentEditor)
  524.   private
  525.     procedure Edit; override;
  526.     procedure ExecuteVerb(Index: Integer); override;
  527.     function GetVerb(Index: Integer): string; override;
  528.     function GetVerbCount: Integer; override;
  529.   end;
  530.  
  531. procedure TStoredProcEditor.Edit;
  532. begin
  533.   ShowDatasetDesigner(Designer, TTable(Component));
  534. end;
  535.  
  536. procedure TStoredProcEditor.ExecuteVerb(Index: Integer);
  537. var
  538.   StoredProc: TStoredProc;
  539. begin
  540.   StoredProc := Component as TStoredProc;
  541.   case Index of
  542.     0: Edit;
  543.     1: EditStoredProcParams(StoredProc, Designer);
  544.     2: ExploreDataset(StoredProc);
  545.   end;
  546. end;
  547.  
  548. function TStoredProcEditor.GetVerb(Index: Integer): string;
  549. begin
  550.   case Index of
  551.     0: Result := LoadStr(SDatasetDesigner);
  552.     1: Result := LoadStr(SBindVerb);
  553.     2: Result := LoadStr(SExplore);
  554.   end;
  555. end;
  556.  
  557. function TStoredProcEditor.GetVerbCount: Integer;
  558. begin
  559.   Result := 3;
  560. end;
  561.  
  562. { TParamsProperty }
  563.  
  564. type
  565.   TParamsProperty = class(TPropertyEditor)
  566.   public
  567.     function GetValue: string; override;
  568.     function GetAttributes: TPropertyAttributes; override;
  569.   end;
  570.  
  571. function TParamsProperty.GetValue: string;
  572. begin
  573.   Result := Format('(%s)', [TParams.ClassName]);
  574. end;
  575.  
  576. function TParamsProperty.GetAttributes: TPropertyAttributes;
  577. begin
  578.   Result := [paMultiSelect, paDialog];
  579. end;
  580.  
  581. { TStoredParamsProperty }
  582.  
  583. type
  584.   TStoredParamsProperty = class(TParamsProperty)
  585.     procedure Edit; override;
  586.   end;
  587.  
  588. procedure TStoredParamsProperty.Edit;
  589. begin
  590.   EditStoredProcParams(GetComponent(0) as TStoredProc, Designer);
  591. end;
  592.  
  593. { TQueryParamsProperty }
  594.  
  595. type
  596.   TQueryParamsProperty = class(TParamsProperty)
  597.     procedure Edit; override;
  598.   end;
  599.  
  600. procedure TQueryParamsProperty.Edit;
  601. var
  602.   List: TParams;
  603.   Query: TQuery;
  604. begin
  605.   Query := GetComponent(0) as TQuery;
  606.   List := TParams.Create;
  607.   try
  608.     List.Assign(Query.Params);
  609.     if EditQueryParams(Query, List) and not List.IsEqual(Query.Params) then
  610.     begin
  611.       Modified;
  612.       Query.Close;
  613.       Query.Params := List;
  614.     end;
  615.   finally
  616.     List.Free;
  617.   end;
  618. end;
  619.  
  620. { TIndexFilesProperty }
  621.  
  622. type
  623.   TIndexFilesProperty = class(TPropertyEditor)
  624.   public
  625.     function GetAttributes: TPropertyAttributes; override;
  626.     procedure Edit; override;
  627.     function GetValue: string; override;
  628.   end;
  629.  
  630. function TIndexFilesProperty.GetAttributes: TPropertyAttributes;
  631. begin
  632.   Result := [paDialog, paReadOnly];
  633. end;
  634.  
  635. function TIndexFilesProperty.GetValue: string;
  636. begin
  637.   Result := Format('(%s)', [TIndexFiles.ClassName]);
  638. end;
  639.  
  640. procedure TIndexFilesProperty.Edit;
  641. var
  642.   List: TStringList;
  643.   Table: TTable;
  644.   I: Integer;
  645.   IndexFile: string;
  646. begin
  647.   Table := GetComponent(0) as TTable;
  648.   List := TStringList.Create;
  649.   try
  650.     List.Assign(Table.IndexFiles);
  651.     if EditIndexFiles(Table, List) then
  652.     begin
  653.       for I := 0 to List.Count - 1 do
  654.       begin
  655.         IndexFile := List[I];
  656.         with Table.IndexFiles do
  657.           if IndexOf(IndexFile) = -1 then Add(IndexFile);
  658.       end;
  659.       for I := Table.IndexFiles.Count - 1 downto 0 do
  660.       begin
  661.         IndexFile := Table.IndexFiles[I];
  662.         with Table.IndexFiles do
  663.           if List.IndexOf(IndexFile) = -1 then Delete(IndexOf(IndexFile));
  664.       end;
  665.       Modified;
  666.     end;
  667.   finally
  668.     List.Free;
  669.   end;
  670. end;
  671.  
  672. { TDBColumnAttributesProperty }
  673.  
  674. type
  675.   TDBColumnAttributesProperty = class(TClassProperty)
  676.   public
  677.     procedure Edit; override;
  678.     function GetAttributes: TPropertyAttributes; override;
  679.   end;
  680.  
  681. procedure TDBColumnAttributesProperty.Edit;
  682. begin
  683.   if EditDBGridColumns(TDBGridColumns(GetOrdValue)) then Modified;
  684. end;
  685.  
  686. function TDBColumnAttributesProperty.GetAttributes: TPropertyAttributes;
  687. begin
  688.   Result := [paDialog, paReadOnly];
  689. end;
  690.  
  691. { TDBGridEditor }
  692. type
  693.   TDBGridEditor = class(TComponentEditor)
  694.     procedure ExecuteVerb(Index: Integer); override;
  695.     function GetVerb(Index: Integer): string; override;
  696.     function GetVerbCount: Integer; override;
  697.   end;
  698.  
  699. procedure TDBGridEditor.ExecuteVerb(Index: Integer);
  700. begin
  701.   if EditDBGridColumns(TDBGrid(Component).Columns) then
  702.     Designer.Modified;
  703. end;
  704.  
  705. function TDBGridEditor.GetVerb(Index: Integer): string;
  706. begin
  707.   Result := LoadStr(SDBGridColEditor);
  708. end;
  709.  
  710. function TDBGridEditor.GetVerbCount: Integer;
  711. begin
  712.   Result := 1;
  713. end;
  714.  
  715. { TUpdateSQLEditor }
  716.  
  717. type
  718.   TUpdateSQLEditor = class(TComponentEditor)
  719.     procedure ExecuteVerb(Index: Integer); override;
  720.     function GetVerb(Index: Integer): string; override;
  721.     function GetVerbCount: Integer; override;
  722.   end;
  723.  
  724. procedure TUpdateSQLEditor.ExecuteVerb(Index: Integer);
  725. begin
  726.   if EditUpdateSQL(TUpdateSQL(Component)) then Designer.Modified;
  727. end;
  728.  
  729. function TUpdateSQLEditor.GetVerb(Index: Integer): string;
  730. begin
  731.   Result := LoadStr(SUpdateSQLEditor);
  732. end;
  733.  
  734. function TUpdateSQLEditor.GetVerbCount: Integer;
  735. begin
  736.   Result := 1;
  737. end;
  738.  
  739. { Registration }
  740.  
  741. procedure Register;
  742. begin
  743.   RegisterComponents(LoadStr(srDAccess), [TDataSource, TTable, TQuery,
  744.     TStoredProc, TDatabase, TSession, TBatchMove, TUpdateSQL]);
  745.   RegisterComponents(LoadStr(srDControls), [TDBGrid, TDBNavigator, TDBText,
  746.     TDBEdit, TDBMemo, TDBImage, TDBListBox, TDBComboBox, TDBCheckBox,
  747.     TDBRadioGroup, TDBLookupListBox, TDBLookupComboBox]);
  748.   RegisterComponents(LoadStr(srWin31), [TDBLookupList, TDBLookupCombo]);
  749.   RegisterNoIcon([TField]);
  750.   RegisterFields([TStringField, TIntegerField, TSmallintField, TWordField,
  751.     TFloatField, TCurrencyField, TBCDField, TBooleanField, TDateField,
  752.     TVarBytesField, TBytesField, TTimeField, TDateTimeField,
  753.     TBlobField, TMemoField, TGraphicField, TAutoIncField]);
  754.   RegisterPropertyEditor(TypeInfo(TDataSet), TDataSource, 'DataSet', TDataSetProperty);
  755.   RegisterPropertyEditor(TypeInfo(TDataSource), TTable, 'MasterSource', TDataSourceProperty);
  756.   RegisterPropertyEditor(TypeInfo(TDataSource), TQuery, 'DataSource', TDataSourceProperty);
  757.   RegisterPropertyEditor(TypeInfo(string), TDatabase, 'AliasName', TAliasNameProperty);
  758.   RegisterPropertyEditor(TypeInfo(string), TDatabase, 'DriverName', TDriverNameProperty);
  759.   RegisterPropertyEditor(TypeInfo(string), TDatabase, 'SessionName', TSessionNameProperty);
  760.   RegisterPropertyEditor(TypeInfo(string), TDBDataSet, 'SessionName', TSessionNameProperty);
  761.   RegisterPropertyEditor(TypeInfo(string), TDBDataSet, 'DatabaseName', TDatabaseNameProperty);
  762.   RegisterPropertyEditor(TypeInfo(TDataSetUpdateObject), TDataSet, 'UpdateObject', TComponentProperty);
  763.   RegisterPropertyEditor(TypeInfo(string), TTable, 'TableName', TTableNameProperty);
  764.   RegisterPropertyEditor(TypeInfo(string), TTable, 'IndexName', TIndexNameProperty);
  765.   RegisterPropertyEditor(TypeInfo(string), TTable, 'IndexFieldNames', TIndexFieldNamesProperty);
  766.   RegisterPropertyEditor(TypeInfo(string), TField, 'KeyFields', TLookupSourceProperty);
  767.   RegisterPropertyEditor(TypeInfo(string), TField, 'LookupKeyFields', TLookupDestProperty);
  768.   RegisterPropertyEditor(TypeInfo(string), TField, 'LookupResultField', TLookupDestProperty);
  769.   RegisterPropertyEditor(TypeInfo(string), TComponent, 'DataField', TDataFieldProperty);
  770.   RegisterPropertyEditor(TypeInfo(string), TDBLookupControl, 'KeyField', TListFieldProperty);
  771.   RegisterPropertyEditor(TypeInfo(string), TDBLookupControl, 'ListField', TListFieldProperty);
  772.   RegisterPropertyEditor(TypeInfo(string), TWinControl, 'LookupField', TLookupIndexProperty);
  773.   RegisterPropertyEditor(TypeInfo(string), TWinControl, 'LookupDisplay', TLookupFieldProperty);
  774.   RegisterPropertyEditor(TypeInfo(string), TDBEdit, 'EditMask', TMaskProperty);
  775.   RegisterPropertyEditor(TypeInfo(string), TField, 'EditMask', TMaskProperty);
  776.   RegisterPropertyEditor(TypeInfo(string), TTable, 'MasterFields', TFieldLinkProperty);
  777.   RegisterPropertyEditor(TypeInfo(TParams), TQuery, 'Params', TQueryParamsProperty);
  778.   RegisterPropertyEditor(TypeInfo(string), TStoredProc, 'StoredProcName', TProcedureNameProperty);
  779.   RegisterPropertyEditor(TypeInfo(TParams), TStoredProc, 'Params', TStoredParamsProperty);
  780.   RegisterPropertyEditor(TypeInfo(TStrings), TTable, 'IndexFiles', TIndexFilesProperty);
  781.   RegisterPropertyEditor(TypeInfo(TDBGridColumns), nil, '', TDBColumnAttributesProperty);
  782.   RegisterComponentEditor(TDataset, TDataSetEditor);
  783.   RegisterComponentEditor(TDatabase, TDatabaseEditor);
  784.   RegisterComponentEditor(TBatchMove, TBatchMoveEditor);
  785.   RegisterComponentEditor(TQuery, TQueryEditor);
  786.   RegisterComponentEditor(TDBImage, TDBImageEditor);
  787.   RegisterComponentEditor(TStoredProc, TStoredProcEditor);
  788.   RegisterComponentEditor(TDBGrid, TDBGridEditor);
  789.   RegisterComponentEditor(TUpdateSQL, TUpdateSQLEditor);
  790.   DBExpt.Register;
  791. end;
  792.  
  793. end.
  794.